package com.example.pulseanalyse.veinType;

import java.util.ArrayList;
import java.util.List;
import java.util.regex.Pattern;

/**
 * @author: yyw
 * time: 2020/12/8 16:17
 * desc:
 */
public class myHelper {
    /// <summary>
    /// 脉诊综合脉型，在报告中显示 ----- 实现方式为每个位置的综合脉型相加去重、去互斥
    /// </summary>
    public static List<String> reportSynPulseType = new ArrayList<>();

    public static List<String> LeftCun = new ArrayList<>();
    public static List<String> LeftGuan = new ArrayList<>();
    public static List<String> LeftChi = new ArrayList<>();

    public static List<String> RightCun = new ArrayList<>();
    public static List<String> RightGuan = new ArrayList<>();
    public static List<String> RightChi = new ArrayList<>();

    public static int GetHanNumFromString(String str) {
        int count = 0;
        String regex = "^[\u4E00-\u9FA5]{0,}$";

        for (int i = 0; i < str.length(); i++) {
            if (Pattern.matches(regex, String.valueOf(str.charAt(i)))) {
                count++;
            }
        }

        return count;
    }

    /// <summary>
    /// 脉型判别时h1的判断依据数值
    /// </summary>
    public static double StaticH1 = 0.5;

}
